#pragma once
namespace yd
{
    class log_level
    {
        public:
        enum class value
        {
            UNKNOW =0,
            DEBUG,
            INFO,
            WARN,
            ERROR,
            FATAL,
            OFF
        };
        static const char*to_string(log_level::value l)
        {
            switch (l)
            {
                #define TOSTRING(name) #name
                case log_level::value::DEBUG: return TOSTRING(DEBUG);
                case log_level::value::INFO: return TOSTRING(INFO);
                case log_level::value::WARN: return TOSTRING(WARN);
                case log_level::value::ERROR: return TOSTRING(ERROR);
                case log_level::value::FATAL: return TOSTRING(FATAL);
                case log_level::value::OFF: return TOSTRING(OFF);
                #undef TOSTRING
                default:return "UNKNOW";
            }
            return "UNKNOW";
        }
    };
}